package com.sikaryofficial.backend.domain.dto.req.information;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sikaryofficial.system.api.model.att.AttachmentResp;
import com.sikaryofficial.system.api.model.infomation.ArticleCategoryObjVO;
import com.sikaryofficial.system.api.model.infomation.FriendObjVO;
import com.sikaryofficial.system.api.model.infomation.TopicObjVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 文章对象 article_t
 *
 * @author qinjinyuan
 * @date 2024-03-13
 */
@Getter
@Setter
@ToString
@ApiModel(value = "后台管理端文章保存请求入参", description = "后台管理端文章保存请求入参")
public class ArticleBackendSaveReq implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 文章ID
     */
    @ApiModelProperty(value = "文章ID")
    private Long articleId;

    /**
     * true 保存， false 更新
     */
    @JsonIgnore
    private boolean hasInsert;

    /**
     * 审核状态:0-草稿,1-审核中(点击发布),2-审核通过(发布成功),3-审核不通过
     */
    @ApiModelProperty(value = "审核状态:0-草稿,1-审核中(点击发布),2-审核通过(发布成功),3-审核不通过")
    @Max(value = 3, message = "audit status could not greater than 3")
    @Min(value = 0, message = "audit status could not less than 0")
    private Integer auditStatus;

    /**
     * 文章标题
     */
    @ApiModelProperty(value = "文章标题")
    @NotBlank(message = "title could not be black")
    @Length(min = 1, max = 500, message = "title could not less than 1 and greater than 500 characters")
    private String headline;

    /**
     * 编辑方式：0-在线编辑 1-导入
     */
    @ApiModelProperty(value = "编辑方式：0-在线编辑 1-导入")
    private Integer editType;

    /**
     * 地址ID：发布地区
     */
    @ApiModelProperty(value = "地址ID：发布地区")
    private Long addressId;

    /**
     * 国家
     */
    @ApiModelProperty(value = "发布国家")
    private String country;
    /**
     * 城市
     */
    @ApiModelProperty(value = "发布城市")
    private String city;
    /**
     * 区域
     */
    @ApiModelProperty(value = "发布区域")
    private String area;

    /**
     * 文章内容
     */
    @ApiModelProperty(value = "文章内容")
    @NotBlank(message = "content could not be black")
    @Length(min = 1, max = 25000, message = "content could not less than 1 and greater than 25000 characters")
    private String content;
    /**
     * 内容类型:0-动态 1-长文
     */
    @ApiModelProperty(value = "内容类型:0-动态 1-长文  2-短视频")
    @Min(value = 0, message = "contentType could not less than 0")
    @Max(value = 2, message = "contentType could not greater than 2")
    private Integer contentType;

    /**
     * 文件来源：1-爬虫 2-后台管理端 3-用户
     */
    @ApiModelProperty(value = "文件来源：1-爬虫 2-后台管理端 3-用户")
    @Min(value = 1, message = "source could not less than 1")
    @Max(value = 3, message = "source could not greater than 3")
    private Integer source;

    /**
     * 封面图片
     */
    @ApiModelProperty(value = "封面图片")
    private String coverUrl;

    @ApiModelProperty(value = "附件列表")
    @Valid
    private List<AttachmentResp> attachmentList;
    /**
     * 子标题对象
     */
    @ApiModelProperty(value = "子标题对象")
    @Valid
    private List<ArticleCategoryObjVO> articleCategoryList;
    /**
     * topic对象
     */
    @ApiModelProperty(value = "topic对象")
    @Valid
    private List<TopicObjVO> topicList;
    /**
     * 好友对象列表
     */
    @ApiModelProperty(value = "好友对象列表")
    @Valid
    private List<FriendObjVO> friendList;
    /**
     * 文章站点
     */
    @ApiModelProperty(value = "文章站点:vaping360 (比如 hasOriginal = 1 ，则进行设值，hasOriginal = 0 则不用赋值)")
    private String articleSite;

    /** 是否原创：0-原创; 1-非原创 */
    @ApiModelProperty(value = "是否原创：0-原创; 1-非原创")
    private Integer hasOriginal;

    /** 是否首发：0-否; 1-是，默认0 */
    @ApiModelProperty(value = "是否首发：0-否; 1-是，默认0")
    private Integer hasFirstEpisode;

    @ApiModelProperty(value = "品牌编码")
    private String brandNo;

    @JsonIgnore
    private Long createdBy;
    @JsonIgnore
    private String createdName;

    @JsonIgnore
    private Long updatedBy;
    @JsonIgnore
    private Date updatedTime;

    @JsonIgnore
    private Integer tenantId;
}
